{% extends 'layout.html' %}

{% block title %}
    <title>新增</title>
{% endblock %}

{% block content %}
    <div class="panel panel-default">
        <!-- Default panel contents -->
        <div class="panel-heading">新增</div>
        <!-- form表单-->
        <div style="box-sizing: border-box;padding: 20px">
            <form method="post" action="{% url 'emp_add' %}" novalidate>
                {#   解决跨站防御攻击            #}
                {% csrf_token %}
                {% for f in form %}
                    <div class="form-group">
                        <label>{{ f.label }}</label>
                        {{ f }}
                        {#显示错误信息#}
                        <span style="color: red">{{ f.errors.0 }}</span>
                    </div>
                {% endfor %}
                <button type="submit" class="btn btn-primary">提交</button>
            </form>
        </div>
    </div>

{% endblock %}